<!DOCTYPE html>
<html>
  <head>
    <meta charset="UTF-8" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <title>Document</title>
    <style>
      .box {
        position: relative;
        width: 8px;
        height: 8px;
        margin: 400px auto;
        background-color: black;
        border-radius: 50%;
      }
      .box .small {
        position: absolute;
        width: 8px;
        height: 8px;
        background-color: pink;
        border-radius: 50%;
      }
    </style>
  </head>
  <body>
    <div class="box"></div>
    <script>
      let box = document.querySelector(".box")

      let stepDeg = (Math.PI * 2) / 100
      // 半径
      let r = 30
      let i = 0
      setInterval(() => {
        let div1 = document.createElement("div")
        div1.className = "small"
        box.appendChild(div1)
        let deg = stepDeg * i
        div1.style.left = `${Math.cos(deg) * r * (i / 100)}px`
        div1.style.top = `${-Math.sin(deg) * r * (i / 100)}px`
        i++
      }, 1000 / 60)
    </script>
  </body>
</html>
